Return user defined structure to dynamic array element